package com.laiketui.order.api.enums;

public enum OrderParentMessageType {
    ORDER_STATUS_PLACE(1, "下单成功"),
    ORDER_PAY_SUCCESS(2, "订单支付成功"),
    ORDER_PAY_FAIL(3, "订单支付失败"),
    ORDER_PAY_TIMEOUT(4, "订单已取消"),
    ORDER_PAY_CHECK_FAIL(5, "审核不通过"),
    ORDER_PAY_CHECK_SUCCESS(6, "审核通过"),
    ORDER_RECEIVE(7, "已发货"),
    EDIT_EXPECTED_DELIVERY_TIME(8, "修改期望发货时间"),
    EDIT_DELIVERY(9, "修改发货地址"),
    EDIT_REMARK(10, "修改母单备注"),
    ORDER_PARENT_FINISH(11, "收货完成"),
    ORDER_TRACK(12, "跟踪订单"),
    ORDER_INVOICE(13, "修改发货单"),
    ;
    private Integer code;
    private String name;

    private OrderParentMessageType(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static String getName(int code) {
        for (OrderParentMessageType type : OrderParentMessageType.values()) {
            if (type.getCode() == code) {
                return type.getName();
            }
        }
        return null;
    }
}
